import 'package:spendbook/models/model.dart';

class BankCard extends Model<BankCard> {
  @override
  String url = '/card';

  String bank = '';

  double _fee = 0.00;

  set fee(dynamic value) {
    _fee = formatDouble(value);
  }

  get fee {
    return _fee;
  }

  @override
  void fromJson(Map<String, dynamic> json) {
    fee = json['fee'];
    bank = json['bank'];
    super.fromJson(json);
  }

  @override
  Map<String, dynamic> toJson() => {
        'id': id,
        'bank': bank,
        'fee': _fee,
      }..addAll(super.toJson());
}
